<?php
namespace jy_manghe;
defined('BY_JYA') or exit('error');
/*
	任务
*/
class task extends \plugin{
	/*
		开奖
	*/
	public function up_openlog(){
		$params=array('uniacid'=>$_SESSION['uniacid'],'status'=>0,'opentime <'=>TIMESTAMP);
		$openlogs = pdo_getall('jy_manghe_openlog',$params);
		if($openlogs){
			foreach($openlogs as $log){
				$this->model('model')->kaijiang($log);
			}
		}
        $params=array('uniacid'=>$_SESSION['uniacid'],'plugin_name'=>'jy_manghe','merchid'=>0,'status'=>1);
        $games = pdo_getall('jy_weishop_game',$params);
        foreach($games as $game){
            $this->model('model')->upopenlog($game);
        }
	}
}